<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Blank line before XML declaration (WordPress)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="icon" href="http://www.feedvalidator.org/favicon.ico" />
<link rel="shortcut icon" href="http://www.feedvalidator.org/favicon.ico" />
<style type="text/css" media="screen">@import "../../css/common.css";
@import "../../css/documentation.css";</style>
<script type="text/javascript"><!-- --></script>
<link rel="start" href="http://feedvalidator.org/docs/" title="Home" />
</head>
<body>
<div id="logo">
<h1><a href="../../"><span id="feed"><span id="f">F</span><span id="e1">E</span><span id="e2">E</span></span><span id="d">D</span> Validator</a></h1>
<p>Documentation</p>
<a class="skip" href="#startnavigation">Jump to navigation</a>
</div> <!--logo-->

<div id="main">
<h2>Message</h2>
<div class="docbody">
<p>Blank line before XML declaration (WordPress)</p>
</div>
<h2>Explanation</h2>

<div class="docbody">
<p>If an XML declaration (<code>&lt;?xml ... ?&gt;</code>) appears in your feed,
it must be the first thing in the feed, before any whitespace.</p>
<p>Unfortunately, with WordPress it seems all too easy for a plugin, a
theme, or for your configuration file to contain a blank line.
Further compounding this problem, some &#x2014; but not all &#x2014; feed
readers compensate for this common error, allowing the error to go undetected
for quite a while.</p>
</div>
<h2>Solution</h2>
<div class="docbody">
<ul>
<li>PHP also uses a similar notation: <code>&lt;?php ... ?&gt;</code>.  Note that the final <em>php</em> <code>?&gt;</code> should be omitted from all PHP code files&#x2014;modules, includes, etc.  The closing delimiter is optional in PHP (but not in XML), and removing it helps prevent unwanted white space at the end of files which can cause problems with your feeds.</li>
<li>Check your <code>wp-rss2.php</code> and <code>wp-atom.php</code> files for
blank lines outside of <code>&lt;?</code> and <code>?&gt;</code> bracketed sections.</li>
<li>Check your <code>wp-config.php</code> file for
blank lines outside of <code>&lt;?</code> and <code>?&gt;</code> bracketed sections.</li>
<li>Check your theme's <code>functions.php</code> file for 
blank lines outside of <code>&lt;?</code> and <code>?&gt;</code> bracketed sections.</li>
<li>One by one, disable plugins and revalidate until you isolate the one causing the problem.</li>
</ul>
</div>
<h2>Not clear?  Disagree?</h2>
<div class="docbody">
<p>You might be able to find help in one of <a href="../howto/resources.html">these fine resources</a>.</p>
</div>

</div><!--main-->
<div class="centered">
<a name="startnavigation" id="startnavigation"></a>
<div class="navbarWrapper">
    <div class="navbarContent">
        <img class="borderTL" src="../../images/borderTL.gif" alt="" width="14" height="14" />
        <img class="borderTR" src="../../images/borderTR.gif" alt="" width="14" height="14" />

<p>
<a href="../../">Home</a> &middot;
<a href="../../about.html">About</a> &middot;
<a href="../../news/">News</a> &middot;
<a href="../../docs/">Docs</a> &middot;
<a href="../../terms.html">Terms</a>
</p>

        <div class="roundedCornerSpacer">&nbsp;</div>
    </div><!-- .content -->
    <div class="bottomCorners">
        <img class="borderBL" src="../../images/borderBL.gif" alt="" width="14" height="14" />
        <img class="borderBR" src="../../images/borderBR.gif" alt="" width="14" height="14" />
    </div><!-- .bottomCorners -->
</div><!-- .contentWrapper -->
</div><!-- .centered -->

<div class="centered">
<address>Copyright &copy; 2002-4 <a href="http://diveintomark.org/">Mark Pilgrim</a> and <a href="http://www.intertwingly.net/blog/">Sam Ruby</a></address>
</div>

</body>
</html>
